<div id="content" class="clearfix">
  <h3><?php echo $this->title;?></h3>
<?php $form=$this->beginWidget('ActiveForm', array(
	'id'=>'login-form',
	'method'=>'get',
	'action'=>$this->createUrl('manager/product'),
	'enableClientValidation'=>true,
	'clientOptions'=>array(
		'validateOnSubmit'=>false,
	),
)); ?>
    <div class="section">
      <h4 class="heading_bg">查询条件</h4>
      <!--      <h5>合约销售查询</h5>-->
      <table width="100%" border="0" cellpadding="0" cellspacing="0" class="normal">
        <tr>
          <th class="tleft"><?php echo $form->label($model,'producttype_code'); ?></th>
          <td id="select">            
            <?php echo $form->dropDownList($model,'producttype_code',Producttype::model()->getListData(),array('prompt'=>'---------','onchange'=>'departEparchyChange(\''.$form->getClientId($model,'eparchy_code').'\',\''.$form->getClientId($model,'depart_code').'\',true)',)); ?>
            <?php echo $form->error($model,'producttype_code'); ?>
          </td>
	    </tr>
	    <tr>
          <th class="tleft"><?php echo $form->label($model,'product_code'); ?></th>
          <td >
            <?php echo $form->textField($model,'product_code',array('size'=>50,)); ?>
            <?php echo $form->error($model,'product_code'); ?>
          </td>
        </tr>
        <tr>
          <th class="tleft"><?php echo $form->label($model,'product_name'); ?></th>
          <td >
            <?php echo $form->textField($model,'product_name',array('size'=>50,)); ?>
            <?php echo $form->error($model,'product_name'); ?>
          </td>
        </tr>
      </table>
      <p class="inquiry">
      	<?php echo CHtml::submitButton('查询',array('class'=>'btn',))?>
      	<?php echo CHtml::resetButton('重置',array('class'=>'btn'))?>
      </p>
      <!--div.section -->
    </div>
    <div class="section">
      <h4 class="heading_bg">查询结果</h4>
      	<?php $this->widget('zii.widgets.grid.CGridView', array(
			'dataProvider'=>$dataProvider,
			//'filter'=>$model,
			'summaryCssClass' => 'summary1',
			'pagerCssClass'=>'pager1',
			'pager'=>array(
				'header'=>'',
				),
			'columns'=>array(
				array(
					'name'=>'product_id',
                    'value'=>'$data->product_id',
                    'htmlOptions'=>array('nowrap'=>'nowrap'),
                    'headerHtmlOptions'=>array('nowrap'=>'nowrap'),
				),
				array(
					'name'=>'product_name',
                    'value'=>'$data->product_name',
                    'htmlOptions'=>array('nowrap'=>'nowrap'),
                    'headerHtmlOptions'=>array('nowrap'=>'nowrap'),
                    //'header'=>'日期'
				),
				array(
					'name'=>'specification',
                    'value'=>'$data->specification',
                    'htmlOptions'=>array('nowrap'=>'nowrap'),
                    'headerHtmlOptions'=>array('nowrap'=>'nowrap'),
                    //'header'=>'日期'
				),
				/*
				array(
					'name'=>'producttype_code',
                    //'value'=>'isset($data->producttypeCode)&&isset($data->producttypeCode->producttype_name)?$data->producttypeCode->producttype_name:\'未归类\'',
                    'value'=>'CJSON::encode(array_slice($data->producttypeCode,0))->producttype_name',
                    //'header'=>'发起人',
                    'htmlOptions'=>array('nowrap'=>'nowrap'),
                    'headerHtmlOptions'=>array('nowrap'=>'nowrap'),
				),
				*/
				array(
					'class'=>'CButtonColumn',
					'htmlOptions'=>array('nowrap'=>'nowrap'),
					'headerHtmlOptions'=>array('nowrap'=>'nowrap'),
					'header'=>'操作',
					'template'=>'{update}',
					//'deleteButtonLabel'=>'删除',
					//'updateButtonLabel'=>'修改',
					//'deleteButtonImageUrl'=>false,
					//'updateButtonImageUrl'=>false,
					'updateButtonUrl'=>'"productupdate?id=".urlencode($data->product_id)',
				),
			), 
		)); ?>
	  <p class="inquiry">
      	<?php echo CHtml::Button('新增商品',array('class'=>'btn','onClick'=>'window.location.href=\''.$this->createUrl('manager/productnew').'\''))?>
      </p>
      <!-- <div class="content-link"><a href="#wrapper">▲回到顶部</a></div> -->
    </div>
<?php $this->endWidget(); ?>
  <!-- div#content end -->
</div>
